/**
 * @param {string} s
 * @param {string} t
 * @return {character}
 */
export var findTheDifference = function (s, t) {
  let ans = 0
  for (let i = 0; i < s.length; i++) {
    ans ^= s.charCodeAt(i)
  }
  for (let i = 0; i < t.length; i++) {
    ans ^= t.charCodeAt(i)
  }
  return String.fromCharCode(ans)
}

export var findTheDifference2 = function (s, t) {
  let as = 0,
    at = 0
  for (let i = 0; i < s.length; i++) {
    as += s[i].charCodeAt()
  }
  for (let i = 0; i < t.length; i++) {
    at += t[i].charCodeAt()
  }
  return String.fromCharCode(at - as)
}
